<script>
import { ref, h } from 'vue'
import { ElButton } from 'element-plus'

export default {
    setup() {

        const isShow = ref(true)

        return () => h('div', [
            h(ElButton, { type: 'primary', onClick: () => isShow.value = !isShow.value }, () => isShow.value ? '隐藏' : '显示'),
            h('div', { class: { none: !isShow.value } }, '君不见黄河之水天上来(类似v-show)'),
            isShow.value ? h('div', '奔流到海不复回(类似v-if)') : null
        ])
    }
}
</script>

<style lang="less" scoped>
.none {
    display: none;
}
</style>